<script setup lang="ts">
import { formatPrice } from '@/utils/tools'
const props = defineProps({
    num: {
        type: String, 
        default: '0.00' 
    },
    color: {
        type: String, 
        default: '#ffffff' 
    },
    unit: {
        type: String, 
        default: '天' 
    }
});

</script>

<template>
    <view class="price-box" :style="{color: color}">
        <text class="int">{{formatPrice(num, 0)}}</text>
        <text class="decimal">{{formatPrice(num, 1)}}</text>
        <text class="unit">/{{ unit }}</text>
    </view>
</template>
<style lang="scss" scoped>
.price-box{
    flex-shrink: 0;
    line-height: 53rpx;
    display: flex;
    font-weight: 900;
    font-family: DINPro;
    align-items: baseline;
    .int{
        margin-left: 6rpx;
        font-size: 36rpx;
    }
    .decimal{   
        font-size: 28rpx;
    }
    .unit{
        margin-left: 6rpx;
        font-size: 18rpx;
        font-weight: normal;
    }
}
</style>
